<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Emp" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2025/8/26
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<b style="color: red"><%=session.getAttribute("mess")%></b>

<%
    ArrayList<Emp> list =(ArrayList<Emp>) session.getAttribute("emps");
%>
<table>

    <tr>
        <td>员工编号</td>
        <td>员工姓名</td>
        <td>岗位</td>
        <td>经理编号</td>
        <td>工资</td>
        <td>奖金</td>
        <td>操作</td>
    </tr>

    <%
    for (int i=0;i<list.size();i++){
    %>
    <tr>
        <td>
            <%=list.get(i).getEmpno()%>
        </td>
        <td>
            <%=list.get(i).getEname()%>
        </td>
        <td>
            <%=list.get(i).getJob()%>
        </td>
        <td>
            <%=list.get(i).getMgr()%>
        </td>
        <td>
            <%=list.get(i).getSal()%>
        </td>
        <td>
            <%=list.get(i).getComm()%>
        </td>
        <td>
            <a href="empdel?empno=<%=list.get(i).getEmpno()%>" onclick="return empdel()";>删除</a>
        </td>
    </tr>
    <%
    }
    %>

    <script type="text/javascript">
        function empdel() {
            var boo=window.confirm("确定删除吗");
            if (boo){
                return true;
            }else {
                return false;
            }
        }
    </script>

</table>
</body>
</html>
